/* 公告管理&&公告列表API */
import request from '@/utils/request'

// 获取公告列表*
export const getNoticeListAPI = (data) => {
	return request({
		url: '/glm/notice/fuzzySearch',
		headers: { repeatSubmit: false },
		method: 'POST',
		data
	})
}

// 接收者查看历史公告*
export const receiverGetNoticeList = (data) => {
	return request({
		url: '/glm/notice/noticeHistory',
		headers: { repeatSubmit: false },
		method: 'POST',
		data
	})
}

// 查看公告详情*
export const getNoticeDetailAPI = (params) => {
	return request({
		url: '/glm/notice/lookNotice',
		method: 'POST',
		params
	})
}

// 获取浏览记录*
export const getReadHistoryList = (params) => {
	return request({
		url: '/glm/notice/readPerson',
		method: 'POST',
		params
	})
}

// 新增公告: 获取公告编号-创建时间
export const getNoticeNumberTimeAPI = (params) => {
	return request({
		url: '/glm/notice/addNotice',
		method: 'POST',
		params
	})
}

// 获取供应商接收人列表*
export const getReceiverList = (data) => {
	return request({
		url: '/glm/notice/searchReceiver',
		method: 'POST',
		data
	})
}

// 2024-4-25开发新接口:获取供应商列表，搜索条件：账号number，名称name，分组id：group
export const getSupplierList = (data) => {
	return request({
		headers: { repeatSubmit: false },
		url: '/glm/notice/supplierList',
		method: 'POST',
		data
	})
}
// 2024-4-25开发新接口:获取公司部门树形列表
export function deptTreeList() {
	return request({
		url: '/system/user/deptTreeExcludeSupplierDept',
		method: 'get'
	})
}

// 2024-4-25开发新接口:获取公司部门内部用户列表
export function getDeptUserList(data) {
	return request({
		headers: { repeatSubmit: false },
		url: '/system/user/employeeList',
		method: 'post',
		data
	})
}

// 获取供应商分组*
export const getGroupList = () => {
	return request({
		url: '/glm/notice/group',
		method: 'POST'
	})
}

// 发布公告或通知*
export const publishNoticeAPI = (data) => {
	return request({
		url: '/glm/notice/publish',
		method: 'POST',
		data
	})
}

// 删除某条公告*
export const deleteNoticeAPI = (data) => {
	return request({
		url: '/glm/notice/deleteNotice',
		method: 'POST',
		data
	})
}

// 编辑未发布的公告-获取公告详情和接接收者*
export const getEditNoticeAPI = (data) => {
	return request({
		url: '/glm/notice/edit',
		method: 'POST',
		data
	})
}

// 接收者确认阅读
export const confirmReadAPI = (data) => {
	return request({
		url: '/glm/notice/confirmRead',
		method: 'POST',
		data
	})
}

// 接收者确认阅读
export const getReceiverAPI = (params) => {
	return request({
		url: '/glm/notice/lookReceiver',
		method: 'POST',
		params
	})
}
